import { defineStore } from 'pinia'

export const useUserStore = defineStore('User', {
  state() {
    return {
      UserID: '', // 存储用户 ID
      UserName: '' // 存储用户名
    }
  },
  actions: {
    // 设置用户信息
    setUser(UserID, UserName) {
      this.UserID = UserID
      this.UserName = UserName
    },
    // 清除用户信息
    clearUser() {
      this.UserID = ''
      this.UserName = ''
    }
  }
})